From 34446ff07c752abb53e912fc6ea0b6899613c83f Mon Sep 17 00:00:00 2001 From: "akw27@arcadians.cl.cam.ac.uk" Date: Thu, 9 Jun 2005 14:07:02 +0000 Subject: [PATCH] bitkeeper revision 1.1699 (42a84d06sZDrQ46g-Bcc7JqWMygr2Q) Fix a bug with snapshots that was introduced with the crc code. --- tools/blktap/Makefile | 2 +- tools/blktap/requests-async.c | 12 ++++++++++-- tools/blktap/vdi.c | 23 +---------------------- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/tools/blktap/Makefile b/tools/blktap/Makefile index a0c197aedb..6ee79ada9c 100644 --- a/tools/blktap/Makefile +++ b/tools/blktap/Makefile @@ -80,7 +80,7 @@ install: all $(INSTALL_PROG) $(IBINS) $(DESTDIR)/$(BLKTAP_INSTALL_DIR) clean: - rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump $(VDI_TOOLS) parallax + rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump $(VDI_TOOLS) parallax vdi_unittest rpm: all rm -rf staging diff --git a/tools/blktap/requests-async.c b/tools/blktap/requests-async.c index 76083c7cc1..f1e0bc8425 100755 --- a/tools/blktap/requests-async.c +++ b/tools/blktap/requests-async.c @@ -50,6 +50,14 @@ struct io_req { void clear_w_bits(radix_tree_node node) { + int i; + for (i=0; ivaddr)]; addr = getid(a); @@ -613,7 +621,7 @@ static void write_cb(struct io_ret r, void *param) DPRINTF("READ_L3_L1f\n"); node = (radix_tree_node) IO_BLOCK(r); - clear_w_bits(node); + clear_L3_w_bits(node); if (node == NULL) goto fail; a = node[L2_IDX(req->vaddr)]; addr = getid(a); diff --git a/tools/blktap/vdi.c b/tools/blktap/vdi.c index 50ead81f01..f3181b86b2 100644 --- a/tools/blktap/vdi.c +++ b/tools/blktap/vdi.c @@ -14,6 +14,7 @@ #include #include "blockstore.h" #include "block-async.h" +#include "requests-async.h" #include "radix.h" #include "vdi.h" @@ -161,28 +162,6 @@ void vdi_put(vdi_t *vdi) freeblock(vdi); } -u64 vdi_lookup_block(vdi_t *vdi, u64 vdi_block, int *writable) -{ - u64 gblock; - - gblock = lookup(VDI_HEIGHT, vdi->radix_root, vdi_block); - - if (writable != NULL) *writable = iswritable(gblock); - - return getid(gblock); -} - -void vdi_update_block(vdi_t *vdi, u64 vdi_block, u64 g_block) -{ - u64 id; - - /* updates are always writable. */ - id = writable(g_block); - - vdi->radix_root = update(VDI_HEIGHT, vdi->radix_root, vdi_block, id); - writeblock(vdi->block, vdi); -} - void vdi_snapshot(vdi_t *vdi) { snap_rec_t rec; -- 2.30.2